<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="js.js"></script>
</head>
<body>
    <div id="div1"></div>
    <div id="div2"></div>
</body>
<script>
    var arr=[];
    for(var i=0;i<8;i++){
        arr.push("歌曲"+i)
    }
    I("#div1")[0].innerHTML= I.map(arr,function(v){
        return "<input type='checkbox'>"+v+"</br>";
    }).join("");
    var btns=[
        {name:"全选",id:"all"},
        {name:"全不选",id:"no"},
        {name:"反选",id:"fan"}
    ];
    I("#div2")[0].innerHTML= I.map(btns,function(v){
        return "<input type='button' value='"+ v.name+"' id="+v.id+">"
    }).join("");
    var inputs=I("#div1 input")
    I("#all")[0].onclick=function(){
        inputs.map(function(v){
            v.checked=true;
        })
    };
    I("#no")[0].onclick=function(){
        inputs.map(function(v){
            v.checked=false;
        })
    };
    I("#fan")[0].onclick=function(){
        inputs.map(function(v){
            v.checked=!v.checked;
        })
    };
</script>
</html>